package DIGUI;

public class Hn {
    public static void main(String[] args) throws Exception {
        hnt(3,"A","B","C");
    }

    public static void hnt(int n, String a, String b, String c) {
        if (n == 1) {
            move(a, b);
        } else {
            hnt(n - 1, a, c, b);
            move(a, b);
            hnt(n - 1, c, b, a);
        }
    }

    public static void move(String a, String b) {
        System.out.println(a + "->" + b);
    }
}
